package com.androidx.p013lv.base.p015ui;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.alibaba.android.arouter.launcher.ARouter;
import com.androidx.p013lv.base.Constance;
import com.androidx.p013lv.base.interfaces.Key;
import com.gyf.immersionbar.ImmersionBar;
import com.gyf.immersionbar.components.ImmersionFragment;
//import com.gyf.immersionbar.components.ImmersionFragment;

/* renamed from: com.androidx.lv.base.ui.LazyFragment */
public abstract class LazyFragment<T extends ViewDataBinding> extends ImmersionFragment {
    protected final String TAG = getClass().getSimpleName();
    public T binding;
    private boolean clickLimit = true;
    private Boolean isFirst = true;
    private Boolean isViewCreated = false;
    private long lastClickTime;

    public void fristInitData() {
    }

    public abstract void initViews();

    public void onFirstUserVisible() {
    }

    public void onUserVisible() {
    }

    public abstract int setFragmentView();

    @Override // androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        if (setFragmentView() == 0) {
            return super.onCreateView(layoutInflater, viewGroup, bundle);
        }
        T t = (T) DataBindingUtil.inflate(layoutInflater, setFragmentView(), viewGroup, false);
        this.binding = t;
        t.setLifecycleOwner(this);
        return this.binding.getRoot();
    }

    public void startVideoPlay(int i) {
        ARouter.getInstance().build(Constance.VIDEO_PLAY_ACTIVITY).withInt(Key.VIDEO_ID, i).navigation();
    }

    @Override // androidx.fragment.app.Fragment, com.gyf.immersionbar.components.ImmersionFragment
    public void onActivityCreated(Bundle bundle) {
        super.onActivityCreated(bundle);
        this.isViewCreated = true;
        initViews();
    }

    @Override // com.gyf.immersionbar.components.ImmersionOwner, com.gyf.immersionbar.components.ImmersionFragment
    public void onVisible() {
        super.onVisible();
        if (!this.isViewCreated.booleanValue() || !this.isFirst.booleanValue()) {
            onUserVisible();
            return;
        }
        onFirstUserVisible();
        this.isFirst = false;
    }

    @Override // com.gyf.immersionbar.components.ImmersionOwner
    public void initImmersionBar() {
        ImmersionBar.with(this).statusBarDarkFont(false).navigationBarDarkIcon(false).autoDarkModeEnable(true).keyboardEnable(false).init();
    }

    @Override // androidx.fragment.app.Fragment
    public void onDestroyView() {
        this.binding = null;
        super.onDestroyView();
    }

    public boolean isOnClick() {
        long currentTimeMillis = System.currentTimeMillis();
        long j = currentTimeMillis - this.lastClickTime;
        if (j > 1000) {
            this.lastClickTime = currentTimeMillis;
        }
        return !this.clickLimit ? j < 0 : j <= 1000;
    }
}
